package com.ruoyi.common.workflow.service.impl;

import com.ruoyi.common.workflow.service.IWorkflowService;
import com.ruoyi.workflow.api.RemoteWorkflowService;
import com.ruoyi.workflow.api.domain.vo.TaskModel;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WorkflowServiceImpl implements IWorkflowService {

    @DubboReference
    private RemoteWorkflowService remoteWorkflowService;

    /**
     * @description: 获取当前任务
     * @param: taskId
     * @return: com.ruoyi.workflow.api.domain.vo.TaskModel
     * @author: gssong
     * @date: 2022/12/10 16:42
     */
    @Override
    public TaskModel getCurrentTask(String taskId) {
        return remoteWorkflowService.getCurrentTask(taskId);
    }

    /**
     * @description: 获取当前任务
     * @param: processInstanceId
     * @return: java.util.List<com.ruoyi.workflow.api.domain.vo.TaskModel>
     * @author: gssong
     * @date: 2022/12/10 16:42
     */
    @Override
    public List<TaskModel> getCurrentTaskList(String processInstanceId) {
        return remoteWorkflowService.getCurrentTaskList(processInstanceId);
    }
}
